package com.team5.service.impl;

import com.team5.entity.News;
import com.team5.mapper.NewsMapper;
import com.team5.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NewsServiceImpl implements NewsService {
    @Autowired
    private NewsMapper mapper;
    @Override
    public News findById(Integer id) {
        return mapper.findById(id);
    }
    @Override
    public News[] findAll() {
        return mapper.findAllSortedByDate();
    }
}
